Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move away from Jobs to Pods #266

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lpiwowar
Copy link
Collaborator

@lpiwowar lpiwowar commented Dec 12, 2024

The test-operator is using Jobs to spawn test pods even though it does
not use any features of this k8s object. Plus usage of the Jobs requires
creation of ServiceAccount in the target namespaces. In order to be able
to create a new, SA the test-oprator has to have a rights to create new
roles and rolebindings which in our case makes the attack surface
larger.

This patch drops the usage of Jobs and moves to Pods.

Depends-On: openstack-k8s-operators/ci-framework#2604

Copy link

openshift-ci bot commented Dec 12, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

openshift-ci bot commented Dec 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lpiwowar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/9f2d32ae798a498fb41c1b99fcb8cb1e

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 22m 41s
podified-multinode-edpm-deployment-crc-test-operator TIMED_OUT in 3h 12m 53s

lpiwowar added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Dec 13, 2024
With this PR [1] the test operator dropped the usage of OCP Jobs for
spawning of the test pods.

This change updates the test-operator role so that it works with the
new version of the test-operator that spawns test pods directly through
the OCP Pods object.

[1] openstack-k8s-operators/test-operator#266
@lpiwowar lpiwowar changed the title Move test-operator away from Jobs Move away from Jobs to Pods Dec 13, 2024
Copy link

This change depends on a change that failed to merge.

Change openstack-k8s-operators/ci-framework#2604 is needed.

@lpiwowar
Copy link
Collaborator Author

recheck

lpiwowar added a commit to lpiwowar/test-operator that referenced this pull request Dec 13, 2024
In this PR [1] we dropped the usage of the Jobs by the test-operator.
This allows us to drop the rights for:

 - ServiceAccount managing & creation
 - Role managing & creation
 - RoleBinding managing & creation

These rights were only needed because Jobs were required to be spawned
with an extra ServiceAccount that would have elevated privileges in case
the test pods need to run with privileged SecurityContext.

[1] openstack-k8s-operators#266

Depends-On: openstack-k8s-operators#266
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/8d8a9fbde32c44ddbc4991307290d9e9

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 15m 41s
podified-multinode-edpm-deployment-crc-test-operator FAILURE in 1h 06m 22s

lpiwowar added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Dec 17, 2024
With this PR [1] the test operator dropped the usage of OCP Jobs for
spawning of the test pods.

This change updates the test-operator role so that it works with the
new version of the test-operator that spawns test pods directly through
the OCP Pods object.

[1] openstack-k8s-operators/test-operator#266
lpiwowar added a commit to openstack-k8s-operators/ci-framework that referenced this pull request Dec 17, 2024
With this PR [1] the test operator dropped the usage of OCP Jobs for
spawning of the test pods.

This change updates the test-operator role so that it works with the
new version of the test-operator that spawns test pods directly through
the OCP Pods object.

[1] openstack-k8s-operators/test-operator#266
@lpiwowar
Copy link
Collaborator Author

recheck

@lpiwowar
Copy link
Collaborator Author

lpiwowar commented Dec 17, 2024

/hold

These PRs need to be merged at the same time. The idea is to first get /approved and /lgtm for both of them and then remove /hold at the same time:

@lpiwowar
Copy link
Collaborator Author

/test all

The test-operator is using Jobs to spawn test pods even though it does
not use any features of this k8s object. Plus usage of the Jobs requires
creation of ServiceAccount in the target namespaces. In order to be able
to create a new, SA the test-oprator has to have a rights to create new
roles and rolebindings which in our case makes the attack surface
larger.

This patch drops the usage of Jobs and moves to Pods.

Depends-On: openstack-k8s-operators/ci-framework#2604
We dropped the usage of Jobs in test-operator. Let's rename the file
to reflect this change.
@lpiwowar
Copy link
Collaborator Author

/test all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant